package com.rbac.mapper.test;

import com.rbac.pojo.Department;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DepartmentMapper {

    @Select("select * from department")
    List<Department> getList();

    @Select("select * from department where id = #{id}")
    Department getDepartmentById(Integer id);

    @Delete("delete from department where id = #{id}")
    int delete(Integer id);

    @Insert("insert into department (name, sn) values (#{name}, #{sn})")
    int save(Department department);

    @Update("update department set name=#{name}, sn=#{sn} where id = #{id}")
    int update(Department department);

}
